package at.ac.tuwien.infosys.aic11.dto;

import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;

@XmlRootElement(name = "offer")
@XmlAccessorType(XmlAccessType.NONE)
public class Offer {

	@XmlAttribute(name="offer_id", required=true)
	private long offerId;
	
	@XmlElement(name="comments", required=true)
	private String comments;
	
	@XmlElement(name="interest_rate", required=true)
	private InterestRate interestRate;
	
	@XmlTransient
	private long requestId;
	
	
	public String toString() {
		return "id=" + offerId + " interestRate=" + interestRate.getRate() + " comments=" + comments;
	}
	

	public Offer(){}
	
	public Offer(long offerId, String comments, InterestRate interestRate){
		this.offerId=offerId;
		this.comments=comments;
		this.interestRate=interestRate;
	}
	
	public Offer(long offerId, String comments, InterestRate interestRate, long requestId){
		this.offerId=offerId;
		this.comments=comments;
		this.interestRate=interestRate;
		this.requestId = requestId;
	}
	
	
	public long getOfferId() {
		return offerId;
	}

	public void setOfferId(long offerId) {
		this.offerId = offerId;
	}

	public String getComments() {
		return comments;
	}

	public void setComments(String comments) {
		this.comments = comments;
	}

	public InterestRate getInterestRate() {
		return interestRate;
	}

	public void setInterestRate(InterestRate interestRate) {
		this.interestRate = interestRate;
	}
	
	public long getRequestId() {
		return requestId;
	}

	public void setRequestId(long requestId) {
		this.requestId = requestId;
	}


}
